<?php
/**
 * Created by PhpStorm.
 * User: zlkmu
 * Date: 2017/8/30
 * Time: 15:31
 */
    require_once ('../Common.php');
    require_once ('FinanceManage.php');
    $item_id = $_REQUEST['item_id'];
    $item_name = $_REQUEST['item_name'];
    $item_type = $_REQUEST['item_type'];
    $is_section = $_REQUEST['is_section'];
    if(!isset($item_id) || !isset($item_type) || !isset($item_name) || !isset($is_section)){
        exit(json_encode(array('state'=>0, 'error'=>'POST_ERROR')));
    }


    $fm = new FinanceManage();
    $r = $fm->modifyFinanceItem($item_id, $item_name, $item_type, $is_section);
    if($r){
        echo json_encode(array('state'=>1));
    }
    else{
        echo json_encode(array('state'=>0, 'error'=>'DB_ERROR'));
    }



?>